##
## Makefile for raytracer in /home/duplomt/work/raytracer
##
## Made by Thomas Duplomb
## Login   <duplomt@epitech.net>
##
## Started on  Wed Jun  8 14:43:29 2011 Thomas Duplomb
## Last update Wed Jun  8 14:55:00 2011 Thomas Duplomb
##

NAME		=	raytracer

# compilation conf

CC		=	gcc

CFLAGS		=	-W -Werror -Wall -O3 -pedantic -ansi

DFLAGS		=

# libraries

LIB_DIR		=	-L./libs/

LIBS		=	-lm

# includes

INCL_DIR	=	./includes/

INCL		=	raytracer.h

# sources

SRCS_DIR	=	./srcs/

SRCS		=	$(wildcard $(SRCS_DIR)*.c)

# objects

OBJS_DIR	=	./objs/

OBJS		=	$(SRCS:.c=.o)

OBJS		:=	$(notdir $(OBJS))

OBJS		:=	$(addprefix $(OBJS_DIR), $(OBJS))

# project utils

RM		=	rm -f

# rules

all:		$(NAME)

$(NAME):	$(OBJS)
		$(CC) -o $(NAME) $(CFLAGS) $(LIBS) $(OBJS)

clean:
		$(RM) $(OBJS) $(SRCS_DIR)*~ $(SRCS_DIR).*~ $(SRCS_DIR)\#*\#

fclean:		clean
		$(RM) $(NAME)

re:		fclean all

# implicit rules

$(OBJS_DIR)%.o:	$(SRCS_DIR)%.c $(INCL)
		$(CC) -c $(CFLAGS) $(DFLAGS) -I$(INCL_DIR) $< -o $@

.PHONY:		all clean fclean re